package CharacterDevelop;

import java.util.Scanner;

/**
 * ClassName:StringTest005
 * Package:CharacterDevelop
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/16-0:52
 * @Version:v1.0
 */
public class StringTest005 {
    public static void main(String[] args) {
        //键盘录入一个字符串,使用程序实现在控制台遍历该字符串
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String str = sc.next();
        //遍历字符串
        for (int i = 0; i < str.length(); i++) {
            //i 依次表示字符串的每一个索引
            char c = str.charAt(i);
            System.out.println(c);
        }

    }
}
